package com.hexiang.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;

@ApiModel(value="user对象",description="用户对象user")
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {
    @ApiModelProperty(value="用户id",name="id",example="11")
    private Integer id;

    @Size(min = 2, max = 10, message = "{user.name.size}")
    @NotEmpty(message = "{user.name.notnull}")
    @ApiModelProperty(value="用户名",name="name",example="xingguo")
    private String name;

    @DecimalMin(value = "1", message = "{user.age.size}")
    @DecimalMax(value = "200", message = "{user.age.size}")
    @ApiModelProperty(value="年龄",name="age",example="22")
    private Integer age;

}